import { Component } from 'react';
import { Input } from 'antd';
const { Search } = Input;
class DrugAllHeader extends Component {
    constructor(props) {
        super(props);
        this.state = { 
            SearchData:[]
         }
    }
    testData=[{
            id:"01001",
            patient_name:'01',
            doctor_name:'01',
            date: '2021.1.2',
            address: "陕西省西安市雁塔区",
            datetime: '2h',
            patient_id: '01001',
          },{
            id:"01002",
            patient_name:'01',
            doctor_name:'02',
            date: '2021.1.2',
            address: "陕西省西安市曲江",
            datetime: '3h',
            patient_id: '01002',
          },{
            id:"01003",
            patient_name:'01',
            doctor_name:'03',
            date: '2021.1.3',
            address: "陕西省宝鸡市新城区",
            datetime: '3h',
            patient_id: '01003',
          }
          ]
    onSearch(){
        setTimeout(() => {
            this.setState({ SearchData: this.testData },()=>{
                this.props.getSearchData(this.state.SearchData);
            });
        }, 1000);
    }
    render() { 
        return (
            <div><Search
            placeholder="input search text"
            enterButton="Search"
            size="large"
            onSearch={()=>this.onSearch()}
          /></div>
        );
    }
}
 
export default DrugAllHeader;